<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="../static/css/prism.css" rel="stylesheet" />
</head>

<body>
    <strong style="color:blueviolet">本节无script演示</strong>

    <h2>concat() 多数组合并</h2>
    <p>将新数组的成员合并到原数组的后面，<strong>返回一个新数组</strong></p>
    <pre><code class="language-javascript">['hello'].concat(['world'])
// ["hello", "world"]

['hello'].concat(['world'], ['!'])
// ["hello", "world", "!"]</code></pre>
    <p>除了数组，同样接受其他类型的多个参数</p>
    <pre><code class="language-javascript">[1, 2, 3].concat(4, 5, 6)
// [1, 2, 3, 4, 5, 6]</code></pre>

    <p><strong>应用场景</strong></p>
    <p>上拉加载，合并数据</p>
    <script src="../static/js/prism.min.js"></script>
</body>

</html>